package com.distribute.api;

import com.distribute.pojo.Task.TaskDefinition;
import com.distribute.pojo.enums.ServiceType;
import com.distribute.pojo.enums.TaskType;
import com.distribute.pojo.project.Project;
import com.distribute.pojo.workflow.*;
import service.api.Service;

public interface ServiceProvider {

    /**
     * 获取服务
     * @param serviceType
     * @return
     */
    Service getService(ServiceType serviceType);



    /**
     * 生成工作流定义
     * @return
     */
    WorkflowDefinition generateWorkFlow(WorkflowStruct tasks);

    /**
     * 创建项目
     * @param projectName
     * @param desc
     * @return
     */
    Project createProject(String projectName, String desc);

    /**
     * 获取项目信息
     * @param projectName
     * @return
     */
    Project getProject(String projectName);

    /**
     * 上线工作流
     * @return
     */
    Boolean onlineWorkflow(WorkflowDefinition workFlowDefinition);

    /**
     * 下线工作流
     * @return
     */
    Boolean offlineWorkflow(WorkflowDefinition workFlowDefinition);

    TaskDefinition genTaskDefinition(String projectName,TaskType taskType);

    WorkflowScheduler createWorkflowScheduler(ScheduleStruct scheduleStruct);

    Boolean startWorkflowInstance(WorkflowInstanceStruct workflowInstanceStruct);






}
